package com.abel.demo.domain;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import java.util.ArrayList;
import java.util.List;

import com.abel.demo.model.UserInfoModel;

/**
* @author abel.lin
* @date_time 2018-07-11 18:26
* @description
*/
public class UserInfoDomain extends UserInfoModel {

    public static UserInfoDomain genDomain(UserInfoModel model){
        if(model == null){
            model = new UserInfoModel();
        }
        UserInfoDomain domain = JSON.parseObject(JSON.toJSONString(model), UserInfoDomain.class);
        return domain;
    }

    public static List<UserInfoDomain> genDomainList(List<UserInfoModel> modelList){
        if(modelList == null){
            modelList = new ArrayList<UserInfoModel>();
        }
        List<UserInfoDomain> domainList = JSONArray.parseArray(JSONArray.toJSONString(modelList), UserInfoDomain.class);
        return domainList;
    }

}
